//
//  WYHttpServer+WYShare.m
//  Boss
//
//  Created by admin on 2018/7/23.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYHttpServer+WYShare.h"

@implementation WYHttpServer (WYShare)
+(void)shareToRedPacket:(NSString *)packetId WithType:(NSString *)type SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion;
{
    
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:packetId forKey:@"packetId"];
    [parm setValue:type forKey:@"type"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlRedPacketShare WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
}
+(void)shareToOpportunityId:(NSString *)opportunityId  SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:opportunityId forKey:@"opportunityId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlOpportunityShare WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

+(void)shareToUser:(NSString *)packetId  SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:packetId forKey:@"packetId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlGetUserShare WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)getStart:(NSString *)packetId  SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
   // [parm setValue:packetId forKey:@"packetId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserStart WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

+(void)sendCitySerViceWithName:(NSString *)name WithPhone:(NSString *)phone WithCode:(NSString *)code WithProvince:(NSString *)province WithCity:(NSString *)city WithCountry:(NSString *)county WithCompany:(NSString *)companyName WithCompanyCase:(NSString *)companyCase SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:name forKey:@"name"];
    [parm setValue:phone forKey:@"phone"];
    [parm setValue:code forKey:@"code"];
    [parm setValue:province forKey:@"province"];
    [parm setValue:city forKey:@"city"];
    [parm setValue:county forKey:@"county"];
    [parm setValue:companyName forKey:@"companyName"];
    [parm setValue:companyCase forKey:@"companyCase"];
    
    
    
    
    
    
    
    
    
    
    
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlCityService WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
    
}

+(void)sendDaySucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    // [parm setValue:packetId forKey:@"packetId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserDay WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)addForwardCountWithRedpacketId:(NSString *)redpacketId WithRedpacketType:(NSString *)redpacketType SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:redpacketId forKey:@"redpacketId"];
    [parm setValue:redpacketType forKey:@"redpacketType"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlForwardCount WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
}

+(void)upLoadDateId:(NSString *)registrationId SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:registrationId forKey:@"registrationId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUpDateId WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
}


@end
